import request from './request';

enum api {
	memberInfo = 'Api/getMemberInfo', // 获取用户信息
	memberList = 'Api/getMemberList', // 用户列表
	vipList = 'Api/getVipList', // vip套餐列表
	getVideoCategoryList = 'Api/getVideoCategoryList', // 栏目视频
	saveVideoCategoryCollect = 'Api/saveVideoCategoryCollect', // 栏目视频收藏/取消收藏
	videoAuthList = 'Api/getVideoAuthList', // 视频认证套餐列表
	createVipOrder = 'Api/createVipOrder', // 创建vip套餐订单
	saveCollect = 'Api/saveCollect', // 收藏/取消收藏
	saveBrowseRecord = 'Api/saveBrowseRecord', // 添加浏览记录
	updateShareCount = 'Api/updateShareCount', // 更新转发数量
	checkUserStateByOneYuan = 'Api/checkUserStateByOneYuan', // 单次付费看视频支付前的检查
	createOneYuanOrder = 'Api/createOneYuanOrder', // 单次付费看视频订单
	createVipAuthOrder = 'Api/createVipAuthOrder', // vip认证订单
	createRedMotherAuthOrder = 'Api/createRedMotherAuthOrder', // 红娘认证订单
	submitStoreApply = 'Api/submitStoreApply', // 门店-提交申请
	updateUserLocation = 'WxStore/updateUserLocation' // 门店-提交申请
}

export function submitStoreApply(data: object) {
	return request.post({ url: api.submitStoreApply, data });
}

export function createRedMotherAuthOrder(user_id: number, amount: number | string) {
	return request.post({ url: api.createRedMotherAuthOrder, data: { user_id, amount } });
}

export function createVipAuthOrder(user_id: number, amount: number | string,package_id: number,is_offline:number,store_id:number) {
	return request.post({ url: api.createVipAuthOrder, data: { user_id, amount,package_id,is_offline,store_id } });
}

export function createOneYuanOrder(user_id: number, like_user_id: number, share_user_id: number) {
	return request.post({ url: api.createOneYuanOrder, data: { user_id, like_user_id, share_user_id } });
}

export function checkUserStateByOneYuan(user_id: number, like_user_id: number) {
	return request.post({ url: api.checkUserStateByOneYuan, data: { user_id, like_user_id } });
}

export function updateShareCount(user_id: number) {
	return request.post({ url: api.updateShareCount, data: { user_id } });
}

export function saveBrowseRecord(user_id: number, like_user_id: number) {
	return request.post({ url: api.saveBrowseRecord, data: { user_id, like_user_id } });
}

export function saveCollect(user_id: number, like_user_id: number) {
	return request.post({ url: api.saveCollect, data: { user_id, like_user_id } });
}

export function saveVideoCategoryCollect(user_id: number, like_user_id: number) {
	return request.post({ url: api.saveVideoCategoryCollect, data: { user_id, like_user_id } });
}

export function createVipOrder(data: object) {
	return request.post({ url: api.createVipOrder, data });
}

export function updateUserLocation(data: object) {
	return request.post({ url: api.updateUserLocation, data });
}

export function vipList() {
	return request.get({ url: api.vipList });
}

export function videoAuthList() {
	return request.get({ url: api.videoAuthList });
}

export function memberList(data: object) {
	return request.post({ url: api.memberList, data });
}

export function getVideoCategoryList(data: object) {
	return request.post({ url: api.getVideoCategoryList, data });
}

export function memberInfo(user_id: string | number) {
	return request.get({ url: api.memberInfo, data: { user_id } });
}
